package com.yvdelx.cyclowomen.object;

import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Root;

import java.util.ArrayList;
import java.util.List;

import static com.yvdelx.cyclowomen.utility.StringUtility.CST_XML_DATA_CYCLE_ELEMENT;
import static com.yvdelx.cyclowomen.utility.StringUtility.CST_XML_DATA_FIRSTNAME_ATTRIBUTE;
import static com.yvdelx.cyclowomen.utility.StringUtility.CST_XML_DATA_NAME_ATTRIBUTE;
import static com.yvdelx.cyclowomen.utility.StringUtility.CST_XML_DATA_PROFILE_ELEMENT;

/**
 * Object Profile, root element in the XML file
 * Created by ydelvaux on 23/02/14.
 */

@Root(name = CST_XML_DATA_PROFILE_ELEMENT)
public class Profile {

    @Attribute(name=CST_XML_DATA_NAME_ATTRIBUTE)
    private String name;

    @Attribute(name=CST_XML_DATA_FIRSTNAME_ATTRIBUTE)
    private String firstname;

    @ElementList(name=CST_XML_DATA_CYCLE_ELEMENT,type=Cycle.class, inline=true)
    private List<Cycle> cycleList;

    @SuppressWarnings("unused") // used by the XML factory
    public Profile(){
        super();
    }

    public Profile(String name, String firstname) {
        this.name = name;
        this.firstname = firstname;
        this.cycleList = new ArrayList<Cycle>();
    }

    public String getName() {
        return this.name;
    }

    public String getFirstname() {
        return this.firstname;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public List<Cycle> getCycleList() {
        return cycleList;
    }

    @SuppressWarnings("unused")
    public void setCycleList(List<Cycle> cycleList) {
        this.cycleList = cycleList;
    }


}
